#
# General Makefile that will include modules in lower directories
#

default: build

help:
	@echo make build - build all binary files
	@echo make clean - removes all files that are created durring make processes
	@echo make docs - creates api and msdn docs
	@echo make dist - builds package for upload to SourceForge

MODULES := $(shell /usr/bin/find -name module.mk)
#include $(MODULES)

.DELETE_ON_ERROR:

build:
	@rm -rf build.log
	@devenv NVelocity.sln /rebuild Debug /out build.log /nologo
	@tail -n 6 build.log
	@rm -rf ../build/temp
	@rm -rf build.log

changelog:
	@updatechangelog.sh

docs:
	@nant
	../bin/NDocConsole.exe -documenter=JavaDoc -project=NVelocity.ndoc

clean:
	-@rm -rf ../build/temp
	-@rm -rf ../build/*dll
	-@rm -rf ../build/*pdb
	-@rm -rf ../build/*exe
	-@rm -rf ../build/*xml
	-@rm -rf ../build/*log
	-@rm -rf ../build/*properties
	-@rm -rf ../www/*
	-@rm -rf NVelocity.xml
	-@rm -rf NVelocity.NAnt.xml 
	-@rm -rf NVelocity.Test.xml 
	-@rm -rf Commons.xml 
	-@rm -rf NUnitRunner.xml 
	-@rm -rf build.log

all: build docs

dist: clean all
	./dist.sh

publishwww:
	scp -r ../www/* corts@nvelocity.sourceforge.net:/home/groups/n/nv/nvelocity/htdocs

publishapi:
	scp -r ../www/api/* corts@nvelocity.sourceforge.net:/home/groups/n/nv/nvelocity/htdocs/api


#
# Rule for displaying debug information.
#
.PHONY : debug

debug:
	@echo MODULES = $(MODULES)
